Skip to content

Docs: add polar, radar, radial bar, pie, and wind rose guides - #371

Merged
Alek99 merged 2 commits into
mainfrom
agent/polar-chart-docs
Jul 30, 2026
Merged

Docs: add polar, radar, radial bar, pie, and wind rose guides#371
Alek99 merged 2 commits into
mainfrom
agent/polar-chart-docs

Conversation

@Alek99

@Alek99 Alek99 commented Jul 28, 2026

Copy link
Copy Markdown
Member

Part 2 of the stack:

  1. Polar coordinate system: heatmap, sectors, log r, and error bars (protocol v12) #370 — polar coordinate system
  2. Docs: add polar, radar, radial bar, pie, and wind rose guides #371 — documentation and examples (this PR)

Summary

  • split the polar family into focused pages for Polar Overview, Radar, Radial Bar, Pie & Donut, and Wind Rose
  • add a dedicated Radial Bar cookbook with a compact six-bar example plus three polished live dashboard blocks: Allocation Overview, Training Summary, and Cache Tiers
  • give the first radial example six named series in distinct purple shades, visible degree/radial axes, and a right-side native legend while keeping its toolbar hidden
  • keep radial data outside chart construction, author explicit tracks and foreground sweeps, demonstrate full and partial sectors, and hide toolbars across all four live radial previews
  • add a dedicated Pie & Donut cookbook with a compact filled pie plus four polished live dashboard blocks: Market Share, Progress Rings, Revenue Mix, and Reliability Score
  • make the first pie example a true base=0 pie driven by an external PIE_DATA variable; angles, widths, percentages, and native legend labels update from the raw values
  • use a four-step purple palette anchored on the docs/sidebar primary #6e56cf
  • keep every Pie & Donut preview toolbar-free with xy.modebar(show=False) while retaining hover, wheel zoom, reset, and export APIs
  • give the dashboard blocks consistent 630 × 360 cards, balanced chart sizing, aligned labels and legends, constant-pixel separators, rounded sectors, center metrics, and clean supporting typography
  • separate Pie & Donut in the Polar Charts sidebar and add its own code-native gallery tile
  • replace the oversized Chart Gallery dropdown with a direct Overview link and sibling family accordions: Core Charts, Distributions, Density & Fields, Specialized, Polar Charts, and Components
  • refine Wind Rose into eight broad compass bins with three stacked speed bands plus directional spokes
  • add a live outlined-radar example and document the parent fix for radar_chart(fill=False), including line color, width, opacity, curve, and dash inheritance
  • document the latest parent tooltip behavior: named series lead the default readout, polar fields use θ/r, and θ reuses authored tick labels or the declared angular unit
  • document the final parent surface: polar heatmap, contour, and error-bar marks; partial-sector layout; display-space holes and data-space radial origins; categorical theta; log/symlog radius; polygonal grids; annotations; gradients; rounded/stroked sectors; export parity; and performance boundaries
  • align the README, changelog, generated API contracts, public cross-guides, roadmaps, and Matplotlib compatibility specs with the implementation

Radial Bar block details

  • Basic Radial Bar Chart: dependency-free RADIAL_DATA, six named purple-shaded bars, degree and radial axes, a right-side legend, and no toolbar
  • Allocation Overview: five compact progress rings, centered percentages, and an aligned exact-value allocation table
  • Training Summary: hero distance and goal rail, three supporting KPI rings, and a narrow operational-stat column
  • Cache Tiers: four nested semicircular capacity bars, a 2 × 2 metric matrix, gradients, and a four-item exact-value legend

Pie block details

  • Basic Pie Chart: toolbar-free, data-driven four-slice filled pie in sidebar-matched purple shades with category percentages in a native legend positioned to the left of the chart
  • Market Share: labeled six-segment donut, centered ecosystem value, and aligned two-column legend
  • Progress Rings: paired 40-position rounded dash rings with centered percentages and captions
  • Revenue Mix: per-slice gradients, rounded separators, dashed center metric, and exact value rows
  • Reliability Score: 240° qualitative gauge, dotted guide, score/status copy, and proportional threshold scale

The polished blocks keep exportable chart geometry inside XY and compose dashboard UI such as center labels and legends with Reflex. Hidden theta/r axes use tick_label_strategy="none" so the chart canvas fills each card without invisible tick gutters.

Stack

Validation

  • docs site tests — 89 passed (2 existing large-scatter soft-ceiling warnings)
  • polar chart tests — 80 passed
  • Ruff check and format check on the modified Python docs files — passed
  • whitespace/diff validation — passed
  • previous full polar API/static/client regression suite — 130 passed, including browser/WebGL probes
  • type-surface tests — 17 passed
  • public API verification — passed
  • protocol-12 browser client rebuild — passed
  • production Reflex compile and build — passed
  • sitemap, Markdown asset, and compiled HTML route validators — passed
  • live browser verification — all four Radial Bar previews and all five Pie & Donut previews expose zero chart-control toolbars; the basic radial legend/axes, allocation rings, training KPIs, and nested cache semicircles remain centered, unclipped, and legible

Summary by CodeRabbit

  • Bug Fixes
    • Improved consistency of polar rendering (including annotation anchoring, padding, fills, and annular styling) across browser, SVG, and native raster outputs.
    • Fixed radar_chart(fill=False) so outlines render correctly using compatible line styling.
    • Adjusted default polar/radar tooltips and readouts to lead with the series name and show θ/r labels appropriately.
  • New Features
    • Added documentation and gallery coverage for polar, radar, radial bar, pie/donut, and wind rose charts.
  • Documentation
    • Expanded polar chart guides, limitations/performance notes, and interactions/export behavior; refreshed Matplotlib polar compatibility guidance.
  • Tests
    • Strengthened docs-site and chart gallery coverage for polar routes, previews, and tooltip defaults.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 22532cec-3666-4b2e-a7da-d4900a2a41e9

📥 Commits

Reviewing files that changed from the base of the PR and between 5973169 and 16f642b.

📒 Files selected for processing (6)
  • README.md
  • docs/app/tests/test_docs_site.py
  • docs/app/xy_docs/api_reference.py
  • docs/app/xy_docs/sidebar.py
  • docs/charts/pie-chart.md
  • spec/design/polar-axes.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • README.md
  • spec/design/polar-axes.md

📝 Walkthrough

Walkthrough

The PR expands polar chart documentation and gallery navigation, adds generated API coverage for polar axes, updates interaction and rendering contracts, and extends documentation and public API validation for polar, radar, radial-bar, pie/donut, and wind-rose chart families.

Changes

Polar documentation and public surface

Layer / File(s) Summary
Gallery navigation and polar API generation
docs/app/xy_docs/*
Adds polar chart-family routes, gallery groups, SVG previews, sidebar behavior, and generated theta_axis/r_axis API parameter documentation.
Polar chart guides and renderer behavior
docs/charts/*, docs/components/*, docs/core-concepts/*, docs/guides/*, docs/integrations/*, python/xy/components.py
Adds polar, radar, radial-bar, pie/donut, and wind-rose guides and documents shared projections, interactions, annotations, tooltips, exports, and Matplotlib compatibility.
Documentation and public API validation
docs/app/tests/*, docs/app/scripts/*, scripts/check_public_api.py, tests/test_type_surface.py
Updates gallery, sidebar, guide, axis-table, public-export, typed-factory, and inline-SVG validation for the expanded polar surface.
Polar contracts and roadmap alignment
CHANGELOG.md, README.md, docs/api-reference/*, spec/api/*, spec/design/*, spec/matplotlib/*
Aligns changelogs, roadmap text, interaction rules, polar design notes, compatibility boundaries, and documented limitations with current polar behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • reflex-dev/xy#311: Both changes modify default tooltip field and label presentation.
  • reflex-dev/xy#388: Provides the related polar rendering and tooltip behavior tracked by these documentation and validation updates.

Suggested reviewers: carlosabadia

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: new documentation guides for polar, radar, radial bar, pie, and wind rose charts.
Docstring Coverage ✅ Passed Docstring coverage is 86.21% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/polar-chart-docs

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Jul 28, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 109 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing agent/polar-chart-docs (16f642b) with main (582cf2c)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Alek99
Alek99 force-pushed the agent/polar-chart-docs branch 3 times, most recently from b301195 to 830b333 Compare July 28, 2026 21:02
@Alek99 Alek99 changed the title Docs: add polar chart guide Docs: add polar, radar, and wind rose guide Jul 28, 2026
@Alek99
Alek99 force-pushed the agent/polar-chart-docs branch from 830b333 to c34b339 Compare July 28, 2026 21:34
@Alek99
Alek99 force-pushed the agent/polar-chart-docs branch 2 times, most recently from 68260ed to 8711bbc Compare July 28, 2026 23:00
@Alek99 Alek99 changed the title Docs: add polar, radar, and wind rose guide Docs: add polar, radar, radial bar, and wind rose guides Jul 28, 2026
@Alek99
Alek99 force-pushed the agent/polar-chart-docs branch 6 times, most recently from f19544d to 13c1325 Compare July 29, 2026 00:56
@Alek99
Alek99 force-pushed the agent/polar-chart-docs branch 2 times, most recently from c88219b to 1d057dd Compare July 29, 2026 01:40
@Alek99 Alek99 changed the title Docs: add polar, radar, radial bar, and wind rose guides Docs: add polar, radar, radial bar, pie, and wind rose guides Jul 29, 2026
@Alek99
Alek99 force-pushed the agent/polar-chart-docs branch 7 times, most recently from e7429d8 to e96da38 Compare July 29, 2026 04:13
@Alek99
Alek99 force-pushed the agent/polar-chart-docs branch from e96da38 to 407d940 Compare July 30, 2026 17:44
@Alek99
Alek99 marked this pull request as ready for review July 30, 2026 17:45
@Alek99
Alek99 force-pushed the agent/polar-chart-docs branch from 407d940 to 434d323 Compare July 30, 2026 18:35

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 35 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/components/tooltips.md">

<violation number="1" location="docs/components/tooltips.md:26">
P2: The new docs claim that `labels={"x": ...}` opts the suppressed polar angle back into the tooltip. The `labels` parameter only renames display labels for fields already in the default set — it does not control which fields appear. A reader trying to show the theta value would need `fields=["x"]` (or its polar equivalent) instead. Consider clarifying that `fields=` controls visibility while `labels=` only renames the display text.</violation>
</file>

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Fix all with cubic | Re-trigger cubic

Comment thread docs/components/tooltips.md
Comment thread docs/charts/pie-chart.md
Comment thread docs/app/xy_docs/api_reference.py Outdated
@Alek99
Alek99 force-pushed the agent/polar-chart-docs branch 2 times, most recently from 118edaf to f8cf5d5 Compare July 30, 2026 20:44
Base automatically changed from alek/polar-axes to main July 30, 2026 21:22
@Alek99
Alek99 force-pushed the agent/polar-chart-docs branch from 2570820 to 5973169 Compare July 30, 2026 21:30

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (3)
tests/test_type_surface.py (1)

363-374: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fold the required-argument cases into one mapping.

The factory names are listed twice (branch chain plus the exemption set at line 373), so adding another argument-taking factory means editing two places.

♻️ Proposed refactor
+REQUIRED_CHART_ARGS = {
+    "radar_chart": (["a", "b", "c"],),
+    "wind_rose": ([0.0], [1.0]),
+    "pie_chart": (["a", "b"], [1.0, 2.0]),
+}
+
 def test_chart_factories_construct_named_lazy_charts() -> None:
     for name in CHART_FACTORIES:
-        if name == "radar_chart":
-            chart = components.radar_chart(["a", "b", "c"])
-        elif name == "wind_rose":
-            chart = components.wind_rose([0.0], [1.0])
-        elif name == "pie_chart":
-            chart = components.pie_chart(["a", "b"], [1.0, 2.0])
-        else:
-            chart = getattr(components, name)()
+        args = REQUIRED_CHART_ARGS.get(name, ())
+        chart = getattr(components, name)(*args)
         assert isinstance(chart, components.Chart), name
         assert chart.kind == name
-        if name not in {"radar_chart", "wind_rose", "pie_chart"}:
+        if name not in REQUIRED_CHART_ARGS:
             assert chart.children == ()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_type_surface.py` around lines 363 - 374, Refactor the factory
setup in the type-surface test to use one mapping from argument-taking names to
their constructor arguments, replacing the special-case branch chain and the
separate exemption set. Use the mapping both to invoke the appropriate factory
and to determine whether to assert empty children, while preserving the existing
calls for radar_chart, wind_rose, and pie_chart.
docs/app/tests/test_docs_site.py (2)

1254-1265: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider deriving the preview count instead of repeating 34.

The literal now appears at lines 1256, 1263-1265, 1276, 1347, 1512, 1783/1790/1793 and again in docs/app/scripts/check_html_routes.py (INLINE_SVG_PREVIEW_COUNT). Computing it once from _GALLERY_GROUPS in this test file would keep future gallery additions to a single edit here.

♻️ Sketch
+    preview_count = sum(len(group.items) for group in _GALLERY_GROUPS)
     assert len(chart_section) == 20
     assert "XYChart" not in rendered
-    assert rendered.count("dangerouslySetInnerHTML") == 34
+    assert rendered.count("dangerouslySetInnerHTML") == preview_count
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/app/tests/test_docs_site.py` around lines 1254 - 1265, Derive the
expected preview count once from _GALLERY_GROUPS in the test module, then
replace the repeated literal 34 assertions and related expectations with that
shared value, including any matching route-check configuration that should use
the same count. Preserve all existing count checks and update them automatically
when gallery groups gain previews.

1563-1700: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Very brittle prose/count assertions.

This test pins ~60 exact English fragments plus exact occurrence counts (count("~~~python demo exec") == 4, count("xy.modebar(show=False),") == 5, '("Direct", 0, 6, "#5b3cc4")'). Any harmless copy edit or added example breaks it without signalling a real contract regression. Consider narrowing to the behavioral claims that must not drift (e.g. the deferred/stale-limitation absences and demo-ordering checks) and dropping the incidental style/color/count pins.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/app/tests/test_docs_site.py` around lines 1563 - 1700, Narrow
test_polar_guides_track_the_current_coordinate_system_contract to stable
behavioral assertions, retaining only meaningful stale-limitation absence checks
and essential demo-ordering or presence checks. Remove brittle exact prose,
styling/color literals, and occurrence-count assertions such as demo-exec,
modebar, and data-value counts, while preserving checks that document required
supported behavior and ordering.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/app/tests/test_docs_site.py`:
- Around line 1459-1463: Update the page-content map in the relevant docs-site
test to assert that the /charts/pie-chart/ route contains xy.pie_chart(. Keep
the existing API-table assertion and neighboring chart mappings unchanged so the
page body and API table use the same pie-chart API.

In `@spec/api/chart-roadmap.md`:
- Around line 417-420: Update README.md lines 299-301 to document the shipped
xy.pie_chart(labels, values) API and hole= donut option instead of
xy.pie_chart(xy.pie(...)); update spec/api/chart-roadmap.md lines 453-454 if it
contains the same outdated example, while lines 417-420 require no direct change
because they already describe the correct API.

In `@spec/design/polar-axes.md`:
- Line 179: Update the fenced code block in the polar-axes documentation to
include a language identifier, preferably text, while preserving all existing
pseudo-code content unchanged.

---

Nitpick comments:
In `@docs/app/tests/test_docs_site.py`:
- Around line 1254-1265: Derive the expected preview count once from
_GALLERY_GROUPS in the test module, then replace the repeated literal 34
assertions and related expectations with that shared value, including any
matching route-check configuration that should use the same count. Preserve all
existing count checks and update them automatically when gallery groups gain
previews.
- Around line 1563-1700: Narrow
test_polar_guides_track_the_current_coordinate_system_contract to stable
behavioral assertions, retaining only meaningful stale-limitation absence checks
and essential demo-ordering or presence checks. Remove brittle exact prose,
styling/color literals, and occurrence-count assertions such as demo-exec,
modebar, and data-value counts, while preserving checks that document required
supported behavior and ordering.

In `@tests/test_type_surface.py`:
- Around line 363-374: Refactor the factory setup in the type-surface test to
use one mapping from argument-taking names to their constructor arguments,
replacing the special-case branch chain and the separate exemption set. Use the
mapping both to invoke the appropriate factory and to determine whether to
assert empty children, while preserving the existing calls for radar_chart,
wind_rose, and pie_chart.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 33b9d1c8-2a67-43e7-b48b-1799b6cfd894

📥 Commits

Reviewing files that changed from the base of the PR and between 582cf2c and 5973169.

📒 Files selected for processing (35)
  • CHANGELOG.md
  • README.md
  • docs/api-reference/changelog.md
  • docs/api-reference/chart-factories.md
  • docs/api-reference/limitations-and-alpha-status.md
  • docs/app/scripts/check_html_routes.py
  • docs/app/tests/test_docs_site.py
  • docs/app/xy_docs/api_reference.py
  • docs/app/xy_docs/config.py
  • docs/app/xy_docs/gallery.py
  • docs/app/xy_docs/sidebar.py
  • docs/charts/contour-plot.md
  • docs/charts/heatmap.md
  • docs/charts/pie-chart.md
  • docs/charts/polar-chart.md
  • docs/charts/radar-chart.md
  • docs/charts/radial-bar-chart.md
  • docs/charts/uncertainty.md
  • docs/charts/wind-rose.md
  • docs/components/annotations.md
  • docs/components/modebars-and-interaction-controls.md
  • docs/components/tooltips.md
  • docs/core-concepts/interactions.md
  • docs/core-concepts/large-data-and-performance.md
  • docs/guides/display-and-export.md
  • docs/integrations/matplotlib.md
  • docs/overview/gallery.md
  • python/xy/components.py
  • scripts/check_public_api.py
  • spec/api/chart-kind-contract.md
  • spec/api/chart-roadmap.md
  • spec/api/interaction.md
  • spec/design/polar-axes.md
  • spec/matplotlib/compat.md
  • tests/test_type_surface.py

Comment thread docs/app/tests/test_docs_site.py
Comment thread spec/api/chart-roadmap.md
Comment thread spec/design/polar-axes.md Outdated
@Alek99
Alek99 force-pushed the agent/polar-chart-docs branch from 5973169 to 16f642b Compare July 30, 2026 21:39
@Alek99
Alek99 merged commit d6adb1d into main Jul 30, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant